package com.luo.gmall.pms.api;

import com.luo.gmall.common.bean.PageParamVo;
import com.luo.gmall.common.bean.ResponseVo;
import com.luo.gmall.pms.entity.*;
import com.luo.gmall.pms.vo.ItemGroupVo;
import com.luo.gmall.pms.vo.SaleAttrValueVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author Zoro
 * @date 2021年11月08
 */
public interface GmallPmsApi {


    /**
     * 1.根据skuId查询sku
     */
    @GetMapping("pms/sku/{id}")
    ResponseVo<SkuEntity> querySkuById(@PathVariable("id") Long id);

    /**
     * 2.根据三级分类的id查询一二三级分类信息
     *
     * @param id 三级分类id
     */
    @GetMapping("pms/category/parent/cascade/{id}")
    ResponseVo<List<CategoryEntity>> queryLevelOneTwoThreeByLevelThreeId(@PathVariable Long id);

    /**
     * 3.根据品牌id查询品牌
     */
    @GetMapping("pms/brand/{id}")
    @ApiOperation("详情查询")
    ResponseVo<BrandEntity> queryBrandById(@PathVariable("id") Long id);

    /**
     * 4.根据spuId查询spu
     */
    @GetMapping("pms/spu/{id}")
    ResponseVo<SpuEntity> querySpuById(@PathVariable("id") Long id);

    /**
     * 5.根据skuId查询sku的图片列表
     */
    @GetMapping("pms/skuimages/images/{skuId}")
    ResponseVo<List<SkuImagesEntity>> queryListSkuImagesBySkuId(@PathVariable Long skuId);

    /**
     * 8.根据spuId查询spu下所有sku的销售属性  saleAttrs  V
     */
    @GetMapping("pms/skuattrvalue/saleAttrs/{spuId}")
    ResponseVo<List<SaleAttrValueVo>> querySaleAttrValueVosBySpuId(@PathVariable Long spuId);

    /**
     * 9.根据skuId查询当前sku的销售属性
     */
    @GetMapping("pms/skuattrvalue/currentSaleAttrValues/{skuId}")
    ResponseVo<List<SkuAttrValueEntity>> queryCurrentSaleAttrValuesBySkuId(@PathVariable Long skuId);

    /**
     * 10.根据spuId查询spu下所有销售属性组合与skuId的映射关系
     */
    @GetMapping("pms/skuattrvalue/salesCombo/{spuId}")
    ResponseVo<String> querySpuAllSalesComboMapSkuIdBySpuId(@PathVariable Long spuId);

    /**
     * 11.根据spuId查询描述信息
     */
    @GetMapping("pms/spudesc/{spuId}")
    ResponseVo<SpuDescEntity> querySpuDescById(@PathVariable("spuId") Long spuId);

    /**
     * 12.根据cid spuId skuId查询规格参数分组及组下的规格参数和值
     */
    @GetMapping("pms/attrgroup/itemGroups/{categoryId}")
    ResponseVo<List<ItemGroupVo>> queryWithItemGroupByCategoryIdAndSpuIdAndSkuId(
            @PathVariable Long categoryId,
            @RequestParam("spuId") Long spuId,
            @RequestParam("skuId") Long skuId);


    @PostMapping("pms/spu/page")
    ResponseVo<List<SpuEntity>> querySpuByPageParam(@RequestBody PageParamVo paramVo);


    @GetMapping("pms/sku/spu/{spuId}")
    ResponseVo<List<SkuEntity>> querySkuBySpuId(@PathVariable("spuId") Long spuId);

    @GetMapping("pms/category/parent/{parentId}")
    ResponseVo<List<CategoryEntity>> queryTopCategoriesByParentId(@PathVariable Long parentId);

    @GetMapping("pms/category/parent/subs/{parentId}")
    ResponseVo<List<CategoryEntity>> queryLevelTwoAndThreeCategoryListByParentId(@PathVariable Long parentId);

    @GetMapping("pms/category/{id}")
    ResponseVo<CategoryEntity> queryCategoryById(@PathVariable("id") Long id);

    @GetMapping("pms/skuattrvalue/category/{categoryId}")
    ResponseVo<List<SkuAttrValueEntity>> querySkuAttrValueListBySkuIdAndCategoryId(
            @PathVariable("categoryId") Long categoryId,
            @RequestParam("skuId") Long skuId);

    @GetMapping("pms/spuattrvalue/category/{categoryId}")
    ResponseVo<List<SpuAttrValueEntity>> querySpuAttrValueListBySpuIdAndCategoryId(
            @PathVariable("categoryId") Long categoryId,
            @RequestParam("spuId") Long spuId);


}
